home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 004 / _spconv / !Spconv / c / genutils next >
Text File  |  1994-09-22  |  1KB  |  53 lines

  1. /* Program: Genutils.c
  2.  *
  3.  * Purpose: Provide some general utilties
  4.  *
  5.  */
  6.  
  7. #include <stdlib.h>
  8. #include "os.h"
  9. #include "swis.h"
  10.  
  11. #define COPY_RECURSE                0x1u
  12. #define COPY_FORCE                  0x2u
  13. #define COPY_GIVEN_TIMES            0x4u
  14. #define COPY_CONFIRM                0x8u
  15. #define COPY_VERBOSE                0x10u
  16. #define COPY_QUICK                  0x20u
  17. #define COPY_PROMPT                 0x40u
  18. #define COPY_DELETE                 0x80u
  19. #define COPY_ALLOW_PRINT            0x100u
  20. #define COPY_NO_ATTRIBUTES          0x200u
  21. #define COPY_STAMP                  0x400u
  22. #define COPY_STRUCTURE              0x800u
  23. #define COPY_NEWER                  0x1000u
  24. #define COPY_GIVEN_DESCRIPTOR       0x2000u
  25. #define COPY_LOOK                   0x4000u
  26.  
  27. /*--- Simple file copy mapping to SWI call with no deletion of file --- */
  28. extern BOOL Genutils_Copy_File (char *From, char *To)
  29. {
  30.    os_regset CopySet={{0,0,0,0,0,0,0,0,0,0}};
  31.    int flags=COPY_FORCE;
  32.  
  33.  
  34.    CopySet.r[0]=0x1A;
  35.    CopySet.r[1]=(int) From;
  36.    CopySet.r[2]=(int) To;
  37.    CopySet.r[3]=flags;
  38.  
  39.    if (os_swix(OS_FSControl,&CopySet) != NULL)
  40.       return FALSE;
  41.    else
  42.       return TRUE;
  43.  
  44. }
  45.  
  46. extern BOOL Genutils_Set_File_Type (char *ForFile, int ToType)
  47. {
  48.   if (os_swi3(OS_File,0x12,(int) ForFile, ToType) != NULL)
  49.      return FALSE;
  50.   else
  51.      return TRUE;
  52. }
  53.